Skip to content

Don't block worker thread waiting for SQL transaction#3885

Closed
kim wants to merge 1 commit into
masterfrom
kim/asyncify-begin-sql
Closed

Don't block worker thread waiting for SQL transaction#3885
kim wants to merge 1 commit into
masterfrom
kim/asyncify-begin-sql

Conversation

@kim

@kim kim commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

Enough SQL requests piling up can exhaust the tokio worker pool waiting
to acquire a transaction lock. Move begin_mut_tx to the blocking pool
instead.

Expected complexity level and risk

1

Testing

Covered by existing tests.

Enough SQL requests piling up can exhaust the tokio worker pool waiting
to acquire a transaction lock. Move `begin_mut_tx` to the blocking pool
instead.

@gefjon gefjon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be using asyncify on the database cores, at least currently, as they aren't properly configured with blocking threads. Probably the way to fix this is just to actually configure the blocking threads, with a sensible number of them and with appropriate core pinning.

@gefjon

gefjon commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

I'm also confused by your PR description. This function runs on the database cores, so there should only be one Tokio worker, right?

@kim

kim commented Dec 16, 2025

Copy link
Copy Markdown
Contributor Author

Ah right, I had actually discarded this after realizing it's not the main runtime.
Disregard.

@kim kim closed this Dec 16, 2025
@kim kim deleted the kim/asyncify-begin-sql branch December 16, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants